As is known in the art, there is a trend to provide network processors that perform cryptographic processing of network packets. To facilitate the cryptographic processing, the network processors include cryptographic acceleration units (also referred to as “crypto units”). The crypto units accelerate the cryptographic processing of packet data to support cryptographic processing at network line rate. One example of a network processor including such a crypto unit is the INTEL® IXP2850 network processor manufactured by Intel Corporation.
Two types of cryptographic processing that are commonly performed on network packets are authentication processing (or more simply authentication) and ciphering processing (or more simply ciphering). Authentication is the process of creating a digest of the packet called a MAC (message authentication code), which is sent along with the packet, and which allows the receiver to verify that the packet was indeed sent by the sender (rather than by some third party) and was not modified in transit. Ciphering is the process of encrypting or decrypting the packet, so that only the intended receiver, with the correct cryptographic key, can decrypt the packet and read its contents. Commonly used security protocols perform both ciphering and authentication on each network packet.
Known cipher algorithms include, but are not limited to, 3DES, AES, and RC4 cipher algorithms. The 3DES and AES algorithms are block cipher algorithms, which means that they process data in discrete blocks. The processing block size of the 3DES algorithm is 8 bytes, the processing block size of the AES algorithm is 16 bytes, and the RC4 algorithm is a stream cipher and processes data one byte at a time. These are but some of many cipher algorithms, and have processing block sizes representative of other cipher algorithms.
Known authentication algorithms include, but are not limited to, MD5, SHA1, and AES-XCBC-MAC authentication algorithms. All of these are block-oriented algorithms. The processing block size of the MD5 and SHA1 algorithms is 64 bytes, while the AES-XCBC-MAC algorithm uses a block size of 16 bytes. These are but some of many authentication algorithms, and have processing block sizes representative of other authentication algorithms. It should be appreciated that the length of a network data packet is not required to be a multiple of the block size of a particular cipher or authentication algorithm.
Known security protocols such as IPSEC provide part of the data in a network packet that is subject to ciphering and authentication, while another part of the data is subject only to authentication. The data that is subject only to authentication generally appears at the beginning of the packet. Other security protocols have a similar requirement that part of the data in a network packet is subject to ciphering and authentication, while another part of the data is subject only to authentication.
It should be appreciated that different security protocols can have different size headers associated with a network packet and that the amount of data subject to authentication only is not necessarily a multiple of the block size of the cipher and/or authentication algorithm.
Network packet data subject to ciphering and authentication can have two varieties. In a first variety, as discussed more fully below, incoming unencrypted data subject to ciphering and authentication (to be encrypted) can be ciphered and then sequentially processed by the authentication core. In a second variety, incoming encrypted data subject to ciphering and authentication (to be decrypted) can be processed by both the authentication and cipher cores substantially in parallel. Whether the ciphering and the authentication operations are performed sequentially or in parallel can depend not only on whether packets are to be encrypted or decrypted, but can also depend on the specific security protocol used, for example IPSec.
Once ciphered with the cipher core, data that is ciphered and not yet processed by the authentication core can be referred to as ciphered-network-packet data subject to authentication. Therefore, for a network data packet associated with a security protocol, different types of data exist, including network packet data subject to authentication and ciphering, network packet data subject only to authentication, and ciphered-network-packet data subject to authentication.
In order to provide both cipher processing and authentication processing, some prior art techniques employ a two-pass approach. In the two-pass approach, a network packet is processed in a first pass with cipher processing of network packet data subject to ciphering and authentication. The network packet is then processed in a second pass with authentication processing of the resulting ciphered-network-packet data subject to authentication along with network packet data subject only to authentication. As networks become faster, the two-pass approach tends to limit throughput of network packets. In order to perform both ciphering and authentication at a high data rate, it would be desirable to perform both operations in one pass.
Therefore, it would be desirable to overcome the aforesaid and other disadvantages, and to provide a method and apparatus that can process a network packet data in a security protocol having ciphering and authentication, at full network line speed. It would be further desirable to provide the method and apparatus that is readily adaptable to processing with any cipher algorithm and any authentication algorithm.